use personid npi physician_nppes using "$build_data/panel_physicians", clear 

keep if !missing(npi)
keep if physician_nppes==1
keep personid npi
duplicates drop
rename (personid npi) (personid_spouse npi_spouse)

gisid personid_spouse

save "${intermediate_data}/spouse_physician/npi_spouse.dta", replace
